package widgets;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;

/**
 * 分发- -中断- -响应- -（分发- -响应） * n- -表现
 * dispatchTouchEvent- -onInterceptTouchEvent- -onTouchEvent- -(dispatchTouchEvent- -onTouchEvent) * n- -onClick
 * @author Charlie
 *
 */
public class ViewGroupTest extends ViewGroup implements OnTouchListener, OnClickListener {
	private static final String TAG = ViewGroupTest.class.getSimpleName();

	@Override
	protected void onLayout(boolean changed, int l, int t, int r, int b) {

	}

	public ViewGroupTest(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.setOnClickListener(this);
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		Log.v(TAG, "onTouchEvent()");
		//		return super.onTouchEvent(event);
		return false;
	}

	@Override
	public boolean onInterceptTouchEvent(MotionEvent ev) {
		Log.v(TAG, "onInterceptTouchEvent()");
		//		return super.onInterceptTouchEvent(ev);
		return false;
	}

	@Override
	public boolean dispatchTouchEvent(MotionEvent ev) {
		Log.v(TAG, "dispatchTouchEvent");
		return false;
		//		return super.dispatchTouchEvent(ev);
	}

	@Override
	public void onClick(View v) {

		Log.v(TAG, "onClick()");
	}

	@Override
	public boolean onTouch(View v, MotionEvent event) {
		Log.v(TAG, "onTouch()");
		return false;
	}
}
